# -*- coding: utf-8 -*-
# Created by 'Zhou Bingbing'  on 2019/8/23
from config_setting.config_setting import TEST_SENTENCE_URL, session
from sys_corpus.corpus_generate import corpus_generate_main, corpus_generate_test_sentence_main
from fanyi.run_fanyi import main
from util.paixu import sort

if __name__=='__main__':
    # '''利用beamsearch +爬虫 进行生成语料'''
    # text=input('请输入文本：')
    # result_sentences=corpus_generate_main(text)

    '''利用局部的beamsearch +decode笛卡儿积最后一步+句子通顺性模型+爬虫'''
    text = input('请输入文本：')
    result_sentences = corpus_generate_test_sentence_main(text)
    results={}
    for  result_sentence in result_sentences:
        score=session.get(url=TEST_SENTENCE_URL.format(result_sentence))
        results[result_sentence]=int(score.text)      #按照分数的从大到小的排列出来
    result_sentences=sort(results)
    print(result_sentences)